package com.malguy.services;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author malguy-wang sir
 * @create ${year}-${month}-${day}-${time}
 */
public class load2 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        //获取请求参数
        String name = req.getParameter("username");
        //获取request域的参数
        String username = (String) req.getAttribute("username");
        if(name.equals(username)) System.out.println("二者相同");
    }
}
